﻿using System.Collections.Generic;
using System.Linq;
using Acaweb.Common;
using System.ServiceModel.Activation;
using Acaweb.Model.Entities;
using Components = Acaweb.Componentes.Contracts;

namespace Acaweb.Servicios.Services
{
    [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Required)]
    public class DepartamentosService : Contracts.IDepartamentosService
    {
        Components.IDepartamentosService _DepartamentoComponent = AppCtx.Resolve<Components.IDepartamentosService>();

        public List<Departamentos> GetAll()
        {
            return _DepartamentoComponent.GetAll().OrderBy(t => t.Nombre).ToList();
        }

        public Departamentos GetById(int Id)
        {
            return _DepartamentoComponent.GetById(Id);
        }

        public List<Departamentos> GetByPais(int Codigo)
        {
            return _DepartamentoComponent.GetByPais(Codigo).OrderBy(t => t.Nombre).ToList();
        }

        public List<Departamentos> GetByNombrePais(string NombrePais)
        {
            return _DepartamentoComponent.GetByNombrePais(NombrePais).ToList();
        }
    }
}